<template>
  <div
    class="sticky top-0 z-40 h-16 bg-white shadow-sm flex items-center px-6 border-b border-gray-200 transition-colors duration-300">
    <div class="text-xl font-semibold text-gray-800">{{ session.name }}</div>
    <button @click="goBack" class="ml-auto text-blue-500 hover:text-blue-700 text-xl px-3 py-1 transition"
      aria-label="返回">&lt;</button>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import type { Session } from '@/utils/mockData'

defineProps<{ session: Session }>()
const router = useRouter()

function goBack() {
  router.replace({ name: 'Login' })
}
</script>
